#include "./zcb_string.h"

_NODISCARD zcb::size_type zcb::caculateCapacity(const zcb::size_type size)
{
	size_type capacity = SMALL_STRING_CAPACITY;
	if (size > SMALL_STRING_CAPACITY)
	{
		if (size > INT64_MAX)
		{
			_Xlen_string();
		}
		else
		{
			capacity = std::min(static_cast<size_type>(size * 1.5), UINT64_MAX);
		}

	}
	return capacity;
}
